# Makefile
# Qui fonctionne ^^

PRG = aurora
PRG2 = managementbin

# Fichiers dans l'ordre
ML = debug.ml test.ml
ML2 = management.ml
MLI = 

CMO=${ML:.ml=.cmo}
CMX=${ML:.ml=.cmx}
CMX2=${ML2:.ml=.cmx}
CMI=${ML:.mli=.cmi}

OCAMLFLAGS = -I +lablgtk2
OCAMLLD = str.cmxa unix.cmxa lablgtk.cmxa lablgtksourceview2.cmxa
OCAMLOPT = ocamlopt.opt
OCAMLC = ocamlc.opt
OCAMLDEP = ocamldep

all: ${CMX} ${CMX2} ${CMX3}
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -o ${PRG} ${CMX}	
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -o ${PRG2} ${CMX2}	

${PRG}: ${CMX}
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -o $@ ${CMX}	

${PRG2}: ${CMX2}
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -o $@ ${CMX2}	

.SUFFIXES: .ml .mli .cmo .cmx .cmi

.ml.cmx: 
	${OCAMLOPT} ${OCAMLFLAGS} ${OCAMLLD} -c $<

.ml.cmo: 
	${OCAMLC} -c $<

.mli.cmi: 
	${OCAMLC} -c $<

clean:
	rm -f *~ *.o *.cm? *mli ${PRG} ${PRG2} 

fullclean: clean
	rm -f .depend

depend: .depend
.depend: ${ML} ${MLI}
	rm -f .depend
	${OCAMLDEP} ${ML} ${MLI} > .depend
			 
include .depend
